package com.esun.payment_api.controller;

import com.esun.common.api.CommonPage;
import com.esun.common.api.CommonResult;
import com.esun.common.bean.PageRequest;
import com.esun.payment_api.bean.UserBean;
import com.esun.payment_api.domain.SysLog;
import com.esun.payment_api.security.model.LoginBody;
import com.esun.payment_api.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    LogService logService;

    final String moduleName = "系统日志";

    @GetMapping("/getLogList")
    public CommonResult getLogList(@RequestBody PageRequest pageRequest){
        CommonResult commonResult = logService.getLogList(pageRequest);
        logService.writeAccessLog(moduleName, commonResult);
        return commonResult;
    }


}
